Add DELETE support for cancelling blob uploads#2379
Draft
gerrod3 wants to merge 6 commits into
Draft
Conversation
Contributor
Author
Implement the Docker v2 blob upload cancel endpoint so clients can release in-progress uploads instead of waiting for timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
Share the upload created in class setup for RBAC and success cases, and align permission assertions with the delete manifest tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace ORM assertions with GET upload status before and after DELETE. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The class-scoped setup fixture used the function-scoped local_registry fixture, which pytest rejects with ScopeMismatch. Co-authored-by: Cursor <cursoragent@cursor.com>
Create the repository and distribution once in class-scoped setup and start blob uploads only in tests that need an outstanding upload. Co-authored-by: Cursor <cursoragent@cursor.com>
dralley
reviewed
Jul 2, 2026
| container_repository_factory, | ||
| container_distribution_factory, | ||
| ): | ||
| """Create a push repository and distribution for all cancel blob upload tests.""" |
Contributor
There was a problem hiding this comment.
Is the "push" repository terminology still accurate in this instance?
dralley
reviewed
Jul 2, 2026
| upload_uuid = _start_blob_upload(local_registry, full_path, self.repo_name) | ||
| delete_path = f"/v2/{full_path(self.repo_name)}/blobs/uploads/{upload_uuid}" | ||
| user_helpless = gen_user() | ||
| with user_helpless: |
Contributor
There was a problem hiding this comment.
Not sure "helpless" is the best name for it. Maybe "user_no_permissions".
dralley
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DELETE /v2/<name>/blobs/uploads/<uuid>to cancel outstanding blob uploads204 No Contenton success and404 BLOB_UPLOAD_UNKNOWNwhen the upload does not existCloses #482
Test plan
pytest pulp_container/tests/functional/api/test_cancel_blob_upload.pyBLOB_UPLOAD_UNKNOWN401Made with Cursor